package com.sixseven.repository;

import com.sixseven.document.Cowry;
import org.springframework.data.elasticsearch.annotations.Highlight;
import org.springframework.data.elasticsearch.annotations.HighlightField;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * @author Belly
 * @version 1.1.0
 */

public interface CowryRepository extends ElasticsearchRepository<Cowry, Integer> {
    @Highlight(fields = {@HighlightField(name = "name")})
    List<SearchHit<Cowry>> findByNameMatches(String name);
}
